﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="PictureLibraryAdd.aspx.cs"
    Inherits="Manager_PictureLibraryAdd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>新增图库信息</title>
    <style type="text/css">
        .mright
        {
            margin-right: 5px;
        }
        .datecontainer .x-form-field-trigger-wrap
        {
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AjaxLoadingType="mask" AutoSizePanelID="sfObject" />
        <ext:SimpleForm ID="sfObject" runat="server" ShowHeader="false" LabelAlign="left"
            BodyPadding="10px" LabelWidth="95px" AutoScroll="true" FooterBarAlign="center">
            <Items>
                <ext:HiddenField ID="hfPictureId" runat="server">
                </ext:HiddenField>
                <ext:TextBox ID="txtTitle" runat="server" Required="true" Label="图片名称" MaxLength="255"
                    Width="400" EmptyText="请填写图片名称">
                </ext:TextBox>
                <ext:FileUpload ID="fuLogo" runat="server" Label="默认图片" EmptyText="请选择要上传的图片！" Width="400" Required="true">
                </ext:FileUpload>
                <ext:CheckBox ID="cboxStatus" runat="server" Label="状态" Checked="true" Text="显示/隐藏">
                </ext:CheckBox>
                <ext:Panel ID="Panel2" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                    CssClass="x-form-item datecontainer">
                    <Items>
                        <ext:Label ID="Label2" Text="点击率：" runat="server" Width="100px">
                        </ext:Label>
                        <ext:TextBox ID="txtHits" runat="server" Width="60px" Label="点击率" Regex="^\d+$" Text="0"
                            Required="true">
                        </ext:TextBox>
                        <ext:Label ID="Label3" Text="&nbsp;&nbsp;排序：" runat="server">
                        </ext:Label>
                        <ext:TextBox ID="txtOrder" runat="server" Width="60px" Label="排序" Regex="^\d+$" Text="999"
                            Required="true">
                        </ext:TextBox>
                    </Items>
                </ext:Panel>
                <ext:ContentPanel ID="ContentPanel1" runat="server" AutoWidth="true" Title="信息内容">
                    <textarea name="UEditor1" id="UEditor1" runat="server"></textarea>
                </ext:ContentPanel>
            </Items>
            <Toolbars>
                <ext:Toolbar ID="Toolbar2" runat="server" Position="footer">
                    <Items>
                        <ext:Button ID="btnSubmit" runat="server" Text="保存" Icon="systemsave" OnClick="btnSubmit_Click"
                            ValidateForms="sfObject">
                        </ext:Button>
                        <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
                        </ext:ToolbarSeparator>
                        <ext:Button ID="btnReset" runat="server" Text="重置" Icon="reload">
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </Toolbars>
        </ext:SimpleForm>
    </form>

    <script type="text/javascript">
        window.UEDITOR_HOME_URL = "<%= ResolveUrl("~/ueditor/") %>";
    </script>

    <script type="text/javascript" src="../ueditor/editor_config.js"></script>

    <script type="text/javascript" src="../ueditor/editor_all.js"></script>

    <script type="text/javascript">
        var editor;
        function onReady() {
            editor = new UE.ui.Editor({
                initialFrameWidth: '100%',
                initialFrameHeight: 350,
                minFrameHeight: 350,
                autoFloatEnabled: false,
                focus: true
            });
            editor.render("<%=UEditor1.ClientID %>");
        }


        // 提交数据之前同步到表单隐藏字段
        X.util.beforeAjaxPostBackScript = function () {
            editor.sync();
        };

        // 更新编辑器内容
        function updateUEditor(content) {
            window.setTimeout(function () {
                editor.setContent(content);
            }, 100);
        }
    </script>

</body>
</html>
